package com.wyzz.hr.action;

import com.wyzz.hr.base.BaseAction;
import com.wyzz.hr.base.Constants;
import com.wyzz.hr.bo.IClientBO;
import com.wyzz.hr.bo.IEmpContractBo;
import com.wyzz.hr.bo.IEmployeeBo;
import com.wyzz.hr.bo.IIFindTip;
import com.wyzz.hr.bo.IInformationBo;
import com.wyzz.hr.pojo.Client;
import com.wyzz.hr.pojo.Empaddconf;
import com.wyzz.hr.pojo.Empcontract;
import com.wyzz.hr.pojo.Employee;
import com.wyzz.hr.pojo.Emprelations;
import com.wyzz.hr.pojo.Empsalaryadj;
import com.wyzz.hr.pojo.Infoclass;
import com.wyzz.hr.pojo.Userinfo;
import com.wyzz.hr.spring.SpringBeanFactory;
import com.wyzz.hr.util.BaseCrit;
import com.wyzz.hr.util.DatabaseSysConfigManager;
import com.wyzz.hr.util.DateUtil;
import com.wyzz.hr.util.impl.PropertiesFileConfigManager;

import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.struts2.ServletActionContext;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

public class Index extends BaseAction implements Constants {

	public Index() {
	}

	public String execute() throws Exception {
		Map session = ServletActionContext.getContext().getSession();
		Userinfo viewUser = (Userinfo) session.get("userinfo");
		if (viewUser == null) {
			return "login";
		} else {
			return "success";
		}
	}

	public String showMoreTips() {
		Map session = ServletActionContext.getContext().getSession();
		Userinfo viewUser = (Userinfo) session.get("userinfo");
		if (viewUser == null)
			return "login";
		tipList = getMoreTipList(viewUser);
		if (hasAuth(801, new int[0]) || hasAuth(802, new int[] { 3 }))
			viewUser = null;
		return "success";
	}

	public List getIndexTipList(Userinfo viewUser) {
		List tempList = new ArrayList();
		IIFindTip findTip = (IIFindTip) getBean("findTip");
		if (hasAuths("101")) {
			if (tempList.size() < MAX_NUMBER)
				tempList.addAll(getTipContract(new int[] { 500 }));
			if (tempList.size() < MAX_NUMBER)
				tempList.addAll(getTip101(new int[] { 500 }));
		}
		if (hasAuths("111") && tempList.size() < MAX_NUMBER)
			tempList.addAll(getTip111(viewUser));
		if (hasAuths("201") && tempList.size() < MAX_NUMBER)
			tempList.addAll(getTip201());
		if (hasAuths("211") && tempList.size() < MAX_NUMBER)
			tempList.addAll(getTip211(viewUser));
		if (hasAuths("401,3 or 401,2") && tempList.size() < MAX_NUMBER)
			tempList.addAll(findTip.getTip401());
		if (hasAuths("411,2 or 411,3") && tempList.size() < MAX_NUMBER)
			tempList.addAll(findTip.getTip4112(getCurrentPosNo()));
		if (hasAuths("411") && tempList.size() < MAX_NUMBER)
			tempList.addAll(findTip.getTip411(viewUser.getId()));
		if (hasAuths("301,3 or 301,2") && tempList.size() < MAX_NUMBER)
			tempList.addAll(findTip.getTip301());
		if (hasAuths("311,3 or 311,2") && tempList.size() < MAX_NUMBER)
			tempList.addAll(findTip.getTip3112(getCurrentPosNo()));
		if (hasAuths("311") && tempList.size() < MAX_NUMBER)
			tempList.addAll(findTip.getTip311(viewUser.getId()));
		if (hasAuths("601,3 or 601,2") && tempList.size() < MAX_NUMBER)
			tempList.addAll(findTip.getTip601());
		if (hasAuths("611,3 or 611,2") && tempList.size() < MAX_NUMBER)
			tempList.addAll(findTip.getTip6112(getCurrentPosNo()));
		if (hasAuths("611") && tempList.size() < MAX_NUMBER)
			tempList.addAll(findTip.getTip611(viewUser.getId()));
		return tempList;
	}

	public List getMoreTipList(Userinfo viewUser) {
		List tempList = new ArrayList();
		IIFindTip findTip = (IIFindTip) getBean("findTip");
		if (hasAuths("101")) {
			tempList.addAll(getTipContract(new int[] { 500 }));
			tempList.addAll(getTip101(new int[] { 500 }));
		}
		if (hasAuths("111"))
			tempList.addAll(getTip111(viewUser));
		if (hasAuths("201"))
			tempList.addAll(getTip201());
		if (hasAuths("211"))
			tempList.addAll(getTip211(viewUser));
		if (hasAuths("401,3 or 401,2"))
			tempList.addAll(findTip.getTip401());
		if (hasAuths("411,3 or 411,2"))
			tempList.addAll(findTip.getTip4112(getCurrentPosNo()));
		if (hasAuths("411"))
			tempList.addAll(findTip.getTip411(viewUser.getId()));
		if (hasAuths("301,3 or 301,2"))
			tempList.addAll(findTip.getTip301());
		if (hasAuths("311,3 or 311,2"))
			tempList.addAll(findTip.getTip3112(getCurrentPosNo()));
		if (hasAuths("311"))
			tempList.addAll(findTip.getTip311(viewUser.getId()));
		if (hasAuths("601,3 or 601,2"))
			tempList.addAll(findTip.getTip601());
		if (hasAuths("611,3 or 611,2"))
			tempList.addAll(findTip.getTip6112(getCurrentPosNo()));
		if (hasAuths("611"))
			tempList.addAll(findTip.getTip611(viewUser.getId()));
		return tempList;
	}

	public void getInfos(String empId) {
		IInformationBo infoBo = (IInformationBo) getBean("informationBo");
		List list = infoBo.getInfoClassBySortId();
		if (list == null || list.size() == 0) {
			proclaimName = newsName = "\u4FE1\u606F\u4E0D\u5B58\u5728";
			proclaimId = newsId = null;
		} else if (list.size() == 1) {
			proclaimName = ((Infoclass) list.get(0)).getInfoclassName();
			newsName = "\u4FE1\u606F\u4E0D\u5B58\u5728";
			proclaimId = ((Infoclass) list.get(0)).getId();
			newsId = null;
		} else if (list.size() > 1) {
			proclaimName = ((Infoclass) list.get(0)).getInfoclassName();
			newsName = ((Infoclass) list.get(1)).getInfoclassName();
			proclaimId = ((Infoclass) list.get(0)).getId();
			newsId = ((Infoclass) list.get(1)).getId();
		}
		if (hasAuth(801, new int[0]) || hasAuth(802, new int[] { 3 }))
			empId = null;
		proclaimList = infoBo.getListbyClass(proclaimId, empId);
		newsList = infoBo.getListbyClass(newsId, empId);
	}

	public void getExpDates() {
		IClientBO clientBo = (IClientBO) SpringBeanFactory.getBean("clientBo");
		HttpSession sessionClient = ServletActionContext.getRequest()
				.getSession();
		Client client = clientBo.loadOneClient(sessionClient.getAttribute(
				"clientNo").toString());
		cliStatus = client.getClientStatus();
		if (cliStatus.intValue() == 1) {
			Integer days = Integer.valueOf(30 - DateUtil.dateDiff(client
					.getClientActivateTime(), new Date(), 5));
			expDays = days.toString();
		} else if (cliStatus.intValue() == 8) {
			Hashtable clientTable = ClientLimit.getClientLimit(client);
			String dateLimitString = (String) clientTable.get("dateLimit");
			if (dateLimitString.length() > 0) {
				Integer days = Integer.valueOf(DateUtil.dateDiff(DateUtil
						.formatTodayDate(), dateLimitString, 5));
				if (days.intValue() < 30)
					expDays = days.toString();
			}
		}
	}

	public ArrayList getTipContract(int maxNum[]) {
		DetachedCriteria dcEmp = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Employee.class);
		dcEmp.createAlias(Employee.PROP_EMP_CONTRACT, "con", 1);
		BaseCrit.addDC(dcEmp, Employee.PROP_EMP_STATUS, "eq",
				new Integer[] { Integer.valueOf(1) });
		if (!hasAuths("101,3 or 101,2"))
			addSubDC(dcEmp, "", 1);
		addOrders(dcEmp, null,
				new String[] {
						(new StringBuilder()).append("con.").append(
								Empcontract.PROP_ECT_END_DATE).append("-up")
								.toString(),
						(new StringBuilder()).append(
								Employee.PROP_EMP_DISTINCT_NO).append("-up")
								.toString() });
		IEmpContractBo empContractBo = (IEmpContractBo) getBean("empContractBo");
		List empWithContracts = empContractBo.findContractByEmp(dcEmp, null,
				null);
		if (empWithContracts == null || empWithContracts.size() == 0)
			return new ArrayList();
		int tipDays = 30;
		String day = DatabaseSysConfigManager.getInstance().getProperty(
				"sys.contract.expire.remind");
		if (StringUtils.isNotEmpty(day))
			tipDays = Integer.valueOf(day).intValue();
		StringBuffer noContract = new StringBuffer();
		StringBuffer expContract = new StringBuffer();
		Date today = DateUtil.convDateTimeToDate(new Date());
		Date tipDate = DateUtil.dateAdd(today, tipDays);
		int count = 0;
		Iterator i$ = empWithContracts.iterator();
		do {
			if (!i$.hasNext())
				break;
			Employee emp = (Employee) i$.next();
			if (emp.getContract() == null
					|| !"1".equals(emp.getContract().getEctStatus())) {
				noContract.append((new StringBuilder()).append(
						getJSString((new StringBuilder()).append(
								"../profile/myInfo.action?empNo=").append(
								emp.getId()).append("&empName=").append(
								emp.getEmpName()).append("&tab=3").toString(),
								emp.getEmpName())).append("\u3001").toString());
				count++;
			} else if (emp.getContract().getEctEndDate() != null
					&& DateUtil.compareTwoDay(
							emp.getContract().getEctEndDate(), today) == 1) {
				noContract.append((new StringBuilder()).append(
						getJSString((new StringBuilder()).append(
								"../profile/myInfo.action?empNo=").append(
								emp.getId()).append("&empName=").append(
								emp.getEmpName()).append("&tab=3").toString(),
								emp.getEmpName())).append("\u3001").toString());
				count++;
			} else if (emp.getContract().getEctEndDate() != null
					&& DateUtil.compareTwoDay(
							emp.getContract().getEctEndDate(), tipDate) == 1) {
				expContract.append((new StringBuilder()).append(
						getJSString((new StringBuilder()).append(
								"../profile/myInfo.action?empNo=").append(
								emp.getId()).append("&empName=").append(
								emp.getEmpName()).append("&tab=3").toString(),
								emp.getEmpName())).append("\u3001").toString());
				count++;
			}
		} while (maxNum == null || maxNum.length <= 0 || count <= maxNum[0]);
		ArrayList tipArrayList = new ArrayList();
		if (noContract.length() > 0)
			tipArrayList
					.add((new StringBuilder())
							.append(
									"\u5408\u540C\u672A\u7B7E\u53CA\u5408\u540C\u8FC7\u671F\u7684\u5458\u5DE5\uFF1A<br>")
							.append(
									noContract.substring(0,
											noContract.length() - 1))
							.toString());
		if (expContract.length() > 0)
			tipArrayList
					.add((new StringBuilder())
							.append(tipDays)
							.append(
									"\u5929\u5185\u5408\u540C\u5230\u671F\u7684\u5458\u5DE5\uFF1A<br>")
							.append(
									expContract.substring(0, expContract
											.length() - 1)).toString());
		return tipArrayList;
	}

	public ArrayList getTip101(int maxNum[]) {
		DatabaseSysConfigManager config = DatabaseSysConfigManager
				.getInstance();
		Map props = config.getProperties();
		Date currendDate = DateUtil.convDateTimeToDate(new Date());
		DetachedCriteria dcEmp = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Employee.class);
		dcEmp.add(Restrictions.or(Restrictions.eq(Employee.PROP_EMP_STATUS,
				Integer.valueOf(1)), Restrictions.ge(
				Employee.PROP_EMP_TERMINATE_DATE, DateUtil
						.getYearMonthFirstDay(new Date()))));
		if (!hasAuths("101,3 or 101,2"))
			addSubDC(dcEmp, "", 1);
		addOrders(dcEmp, null, new String[] { (new StringBuilder()).append(
				Employee.PROP_EMP_DISTINCT_NO).append("-up").toString() });
		IEmployeeBo empBo = (IEmployeeBo) getBean("empBo");
		List empList = empBo.findByCriteria(dcEmp);
		DetachedCriteria dcRelations = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Emprelations.class);
		dcRelations.createAlias(Emprelations.PROP_EREL_EMPLOYEE, "employee", 1);
		dcRelations.add(Restrictions.eq("employee.empStatus", Integer
				.valueOf(1)));
		dcRelations.add(Restrictions.eq(
				Emprelations.PROP_EREL_ERELBIRTHDAYREMIND, Integer.valueOf(1)));
		if (!hasAuths("101,3 or 101,2"))
			addSubDC(dcRelations, "employee", 1);
		addOrders(dcRelations, null, new String[] { (new StringBuilder())
				.append("employee.").append(Employee.PROP_EMP_DISTINCT_NO)
				.append("-up").toString() });
		List erelList = empBo.findByCriteria(dcRelations);
		DetachedCriteria additionalDateTip = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Empaddconf.class);
		additionalDateTip.add(Restrictions.eq("eadcFieldType", "date"));
		additionalDateTip
				.add(Restrictions.eq("eadcTableName", "empadditional"));
		additionalDateTip.add(Restrictions.not(Restrictions
				.isNull("eadcFieldValue")));
		additionalDateTip.add(Restrictions.ne("eadcFieldValue", ""));
		List additionalDateTipList = empBo.findByCriteria(additionalDateTip);
		int count = 0;
		Map tipMap = new HashMap();
		Iterator i$;
		for (i$ = additionalDateTipList.iterator(); i$.hasNext();) {
			Empaddconf conf = (Empaddconf) i$.next();
			Integer tipDays = Integer.valueOf(conf.getEadcFieldValue());
			if (tipDays == null)
				break;
			count = 0;
			i$ = empList.iterator();
			label0: do {
				Employee add;
				Date date;
				do {
					do {
						if (!i$.hasNext())
							break label0;
						add = (Employee) i$.next();
					} while (add.getEmpStatus().intValue() == 0);
					date = getDateValue(add, conf.getEadcSeq().intValue());
				} while (date == null);
				if (DateUtil.isDateRemind(date, currendDate,
						tipDays.intValue(), 0)) {
					String tip = (String) tipMap.get(conf.getEadcFieldName());
					String tmp = (new StringBuilder()).append(
							getJSString((new StringBuilder()).append(
									"../profile/myInfo.action?empNo=").append(
									add.getId()).append("&empName=").append(
									add.getEmpName()).append("&tab=2")
									.toString(), add.getEmpName())).append(
							"\u3001").toString();
					if (tip == null) {
						tipMap
								.put(
										conf.getEadcFieldName(),
										(new StringBuilder())
												.append(tipDays)
												.append("\u5929\u5185")
												.append(conf.getEadcFieldName())
												.append(
														"\u5230\u671F\u7684\u5458\u5DE5\uFF1A<br/>")
												.append(tmp).toString());
					} else {
						tipMap.put(conf.getEadcFieldName(),
								(new StringBuilder()).append(
										(String) tipMap.get(conf
												.getEadcFieldName())).append(
										tmp).toString());
						count++;
					}
				}
			} while (maxNum == null || maxNum.length <= 0 || count <= maxNum[0]);
		}

		count = 0;
		StringBuffer birth = new StringBuffer();
		int birtydayTip = 30;
		String birtydayTipDays = (String) props.get("sys.birthday.remind");
		if (StringUtils.isNotEmpty(birtydayTipDays))
			birtydayTip = Integer.parseInt(birtydayTipDays);
		i$ = empList.iterator();
		do {
			if (!i$.hasNext())
				break;
			Employee emp = (Employee) i$.next();
			if (emp.getEmpStatus().intValue() == 1
					&& DateUtil.isDateRemind(emp.getEmpBirthDate(),
							currendDate, birtydayTip, 1)) {
				birth.append((new StringBuilder()).append(
						getJSString((new StringBuilder()).append(
								"../profile/myInfo.action?empNo=").append(
								emp.getId()).append("&empName=").append(
								emp.getEmpName()).append("&tab=1").toString(),
								emp.getEmpName())).append("\u3001").toString());
				count++;
			}
		} while (maxNum == null || maxNum.length <= 0 || count <= maxNum[0]);
		i$ = erelList.iterator();
		do {
			if (!i$.hasNext())
				break;
			Emprelations erel = (Emprelations) i$.next();
			if (erel.getErelBirthday() != null
					&& DateUtil.isDateRemind(erel.getErelBirthday(),
							currendDate, birtydayTip, 1)) {
				birth.append((new StringBuilder()).append(
						getJSString((new StringBuilder()).append(
								"../profile/myInfo.action?empNo=").append(
								erel.getEmployee().getId()).append("&empName=")
								.append(erel.getEmployee().getEmpName())
								.append("&tab=2").toString(),
								(new StringBuilder()).append(
										erel.getEmployee().getEmpName())
										.append("(").append(
												erel.getErelRelationship())
										.append(")").toString())).append(
						"\u3001").toString());
				count++;
			}
		} while (maxNum == null || maxNum.length <= 0 || count <= maxNum[0]);
		count = 0;
		StringBuffer join = new StringBuffer();
		i$ = empList.iterator();
		do {
			if (!i$.hasNext())
				break;
			Employee emp = (Employee) i$.next();
			if (DateUtil.convDateToYM(emp.getEmpJoinDate()).equals(
					DateUtil.convDateToYM(new Date()))) {
				join.append((new StringBuilder()).append(
						getJSString((new StringBuilder()).append(
								"../profile/myInfo.action?empNo=").append(
								emp.getId()).append("&empName=").append(
								emp.getEmpName()).append("&tab=1").toString(),
								emp.getEmpName())).append("\u3001").toString());
				count++;
			}
		} while (maxNum == null || maxNum.length <= 0 || count <= maxNum[0]);
		count = 0;
		StringBuffer confirm = new StringBuffer();
		int confirmTip = 30;
		String confirmTipDays = (String) props.get("sys.trial.expire.remind");
		if (StringUtils.isNotEmpty(confirmTipDays))
			confirmTip = Integer.parseInt(confirmTipDays);
		i$ = empList.iterator();
		do {
			if (!i$.hasNext())
				break;
			Employee emp = (Employee) i$.next();
			if (emp.getEmpStatus().intValue() == 1
					&& emp.getEmpConfirmDate() != null
					&& DateUtil.isDateRemind(emp.getEmpConfirmDate(),
							currendDate, confirmTip, 0)) {
				confirm.append((new StringBuilder()).append(
						getJSString((new StringBuilder()).append(
								"../profile/myInfo.action?empNo=").append(
								emp.getId()).append("&empName=").append(
								emp.getEmpName()).append("&tab=1").toString(),
								emp.getEmpName())).append("\u3001").toString());
				count++;
			}
		} while (maxNum == null || maxNum.length <= 0 || count <= maxNum[0]);
		count = 0;
		StringBuffer out = new StringBuffer();
		i$ = empList.iterator();
		do {
			if (!i$.hasNext())
				break;
			Employee emp = (Employee) i$.next();
			if (emp.getEmpTerminateDate() != null
					&& DateUtil.convDateToYM(emp.getEmpTerminateDate()).equals(
							DateUtil.convDateToYM(new Date()))) {
				out.append((new StringBuilder()).append(
						getJSString((new StringBuilder()).append(
								"../profile/myInfo.action?empNo=").append(
								emp.getId()).append("&empName=").append(
								emp.getEmpName()).append("&tab=1").toString(),
								emp.getEmpName())).append("\u3001").toString());
				count++;
			}
		} while (maxNum == null || maxNum.length <= 0 || count <= maxNum[0]);
		ArrayList tipArrayList = new ArrayList();
		String tmpValue;
		for (i$ = tipMap.keySet().iterator(); i$.hasNext(); tipArrayList
				.add(tmpValue)) {
			String key = (String) i$.next();
			tmpValue = ((String) tipMap.get(key)).substring(0, ((String) tipMap
					.get(key)).length() - 1);
		}

		if (confirm.length() > 0)
			tipArrayList
					.add((new StringBuilder())
							.append(confirmTip)
							.append(
									"\u5929\u5185\u8BD5\u7528\u671F\u7ED3\u675F\u7684\u5458\u5DE5: <br>")
							.append(confirm.substring(0, confirm.length() - 1))
							.toString());
		if (birth.length() > 0)
			tipArrayList
					.add((new StringBuilder())
							.append(birtydayTip)
							.append(
									"\u5929\u5185\u8FC7\u751F\u65E5\u7684\u5458\u5DE5\uFF1A<br>")
							.append(birth.substring(0, birth.length() - 1))
							.toString());
		if (join.length() > 0)
			tipArrayList.add((new StringBuilder()).append(
					"\u672C\u6708\u5165\u804C\u7684\u5458\u5DE5\uFF1A<br>")
					.append(join.substring(0, join.length() - 1)).toString());
		if (out.length() > 0)
			tipArrayList.add((new StringBuilder()).append(
					"\u672C\u6708\u79BB\u804C\u7684\u5458\u5DE5\uFF1A<br>")
					.append(out.substring(0, out.length() - 1)).toString());
		return tipArrayList;
	}

	private Date getDateValue(Employee additional, int index) {
		String method = (new StringBuilder()).append("empAdditional").append(
				index).toString();
		Object rs;
		String result;
		try {
			rs = PropertyUtils.getProperty(additional, method);
			if (rs == null)
				return null;
		} catch (Exception e) {
			return null;
		}
		result = (String) rs;
		return DateUtil.parseDateNoEx(result, "yyyy-MM-dd");
	}

	public ArrayList getTip111(Userinfo viewUser) {
		ArrayList tipArrayList = new ArrayList();
		StringBuffer infoS = new StringBuffer();
		Date lastLoginDate = viewUser.getUiLastLoginTime();
		DetachedCriteria detachedCriteria = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Employee.class);
		detachedCriteria.add(Restrictions.eq("id", viewUser.getId()));
		if (lastLoginDate != null)
			detachedCriteria.add(Restrictions.gt("empLastChangeTime",
					lastLoginDate));
		IEmployeeBo empBo = (IEmployeeBo) getBean("empBo");
		int info = empBo.findRowCountByCriteria(detachedCriteria);
		if (info > 0) {
			infoS.append(getJSString((new StringBuilder()).append(
					"../profile/myInfo.action?tab=1&empNo=").append(
					viewUser.getId()).append("&empName=").append(
					viewUser.getEmployee().getEmpName()).toString(),
					"\u67E5\u770B"));
			tipArrayList
					.add((new StringBuilder())
							.append(
									"\u60A8\u7684\u5458\u5DE5\u57FA\u672C\u8D44\u6599\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u6CE8\u610F")
							.append(infoS).append("\u3002<br>").toString());
		}
		return tipArrayList;
	}

	public ArrayList getTip201() {
		ArrayList tipArrayList = new ArrayList();
		Date currendDate = DateUtil.convDateTimeToDate(new Date());
		DetachedCriteria dcEsa = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Empsalaryadj.class);
		dcEsa.createAlias(Empsalaryadj.PROP_ESA_EMPNO, "employee", 1);
		BaseCrit.addDC(dcEsa, Empsalaryadj.PROP_ESA_STATUS, "eq",
				new Integer[] { Integer.valueOf(11) });
		BaseCrit.addDCDateRange(dcEsa, Empsalaryadj.PROP_ESA_EFFDATE_PRO,
				DateUtil.getYearMonthFirstDay(currendDate), DateUtil
						.getYearMonthEndDay(currendDate));
		if (!hasAuths("201,3 or 201,2"))
			addSubDC(dcEsa, "employee", 2);
		IEmployeeBo empBo = (IEmployeeBo) getBean("empBo");
		int number = empBo.findRowCountByCriteria(dcEsa);
		if (number != 0) {
			String tempS = getJSString(
					"../compensation/searchCompaplan.action?compaplan.esaStatus=11",
					"\u8C03\u6574");
			tipArrayList.add((new StringBuilder()).append("\u672C\u6708\u6709")
					.append(number).append("\u4E2A\u5458\u5DE5\u9700\u8981")
					.append(tempS).append("\u85AA\u8D44\u3002<br>").toString());
		}
		return tipArrayList;
	}

	public ArrayList getTip211(Userinfo viewUser) {
		ArrayList tipArrayList = new ArrayList();
		Date lastLoginDate = viewUser.getUiLastLoginTime();
		StringBuffer salaryS = new StringBuffer();
		DetachedCriteria detachedCriteria3 = DetachedCriteria
				.forClass(com.wyzz.hr.pojo.Empsalaryconfig.class);
		detachedCriteria3.add(Restrictions.eq("id", viewUser.getId()));
		if (lastLoginDate != null)
			detachedCriteria3.add(Restrictions.gt("escLastChangeTime",
					lastLoginDate));
		IEmployeeBo empBo = (IEmployeeBo) getBean("empBo");
		int salary = empBo.findRowCountByCriteria(detachedCriteria3);
		if (salary > 0) {
			salaryS.append(getJSString("../compensation/mySalaryPaid.action",
					"\u67E5\u770B"));
			tipArrayList
					.add((new StringBuilder())
							.append(
									"\u60A8\u7684\u85AA\u8D44\u672C\u6708\u5DF2\u8C03\u6574\uFF0C\u8BF7\u6CE8\u610F")
							.append(salaryS).append("\u3002<br>").toString());
		}
		return tipArrayList;
	}

	public String getJSString(String action, String tip) {
		return (new StringBuilder())
				.append("<span onclick =\"toAction('")
				.append(action)
				.append(
						"');\" style =\"cursor:pointer\"><font color =\"blue\">")
				.append(tip).append("</font></span>").toString();
	}

	public List getTipList() {
		return tipList;
	}

	public void setTipList(List tipList) {
		this.tipList = tipList;
	}

	public String getNewsId() {
		return newsId;
	}

	public void setNewsId(String newsId) {
		this.newsId = newsId;
	}

	public String getProclaimId() {
		return proclaimId;
	}

	public void setProclaimId(String proclaimId) {
		this.proclaimId = proclaimId;
	}

	public String getNewsName() {
		return newsName;
	}

	public void setNewsName(String newsName) {
		this.newsName = newsName;
	}

	public String getProclaimName() {
		return proclaimName;
	}

	public void setProclaimName(String proclaimName) {
		this.proclaimName = proclaimName;
	}

	public Integer getCliStatus() {
		return cliStatus;
	}

	public void setCliStatus(Integer cliStatus) {
		this.cliStatus = cliStatus;
	}

	public String getExpDays() {
		return expDays;
	}

	public void setExpDays(String expDays) {
		this.expDays = expDays;
	}

	public List getNewsList() {
		return newsList;
	}

	public void setNewsList(List newsList) {
		this.newsList = newsList;
	}

	public List getProclaimList() {
		return proclaimList;
	}

	public void setProclaimList(List proclaimList) {
		this.proclaimList = proclaimList;
	}

	public Employee getLoginEmp() {
		return loginEmp;
	}

	public void setLoginEmp(Employee loginEmp) {
		this.loginEmp = loginEmp;
	}

	private static final long serialVersionUID = 0xc53a77b0ae03eebfL;
	private static final int MAX_NUMBER;
	private List proclaimList;
	private String proclaimId;
	private String proclaimName;
	private List newsList;
	private String newsId;
	private String newsName;
	private List tipList;
	private Employee loginEmp;
	private String expDays;
	private Integer cliStatus;

	static {
		String strNumber = PropertiesFileConfigManager.getInstance()
				.getProperty("sys.homepage.tips");
		MAX_NUMBER = Integer
				.valueOf(StringUtils.defaultIfEmpty(strNumber, "3")).intValue();
	}
}
